home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #2 / Monster Media No. 2 (Monster Media)(1994).ISO / prog_pas / ddplus63.zip / DDOVR.PAS < prev    next >
Pascal/Delphi Source File  |  1994-07-09  |  28KB  |  946 lines

  1. unit ddovr;
  2. {$O+,F+,V-}
  3.  
  4. interface
  5.  
  6. uses crt;
  7.  
  8. { procedure showhelp;}
  9.  
  10. procedure GetBBSInfo(
  11.  bbstype: word;
  12.  var user_first_name,user_last_name: string;
  13.  var user_access_level: word;
  14.  var bbs_time_left: integer;
  15.  var com_port: byte;
  16.  var baud_rate : Longint;
  17.  var node_num: byte;
  18.  var local: boolean;
  19.  var graphics: byte;
  20.  var color1: boolean;
  21.  var color_chg: boolean;
  22.  var board_name: string;
  23.  var sysop_first_name: string;
  24.  var sysop_last_name: string;
  25.  var maxtime: word;
  26.  var dropfilepath: string;
  27.  var lockbaud: LongInt);
  28.  
  29. procedure MakeInfoStrings(
  30.  bbstype: word;
  31.  var user_first_name,user_last_name: string;
  32.  var user_access_level: word;
  33.  var bbs_time_left: integer;
  34.  var com_port: byte;
  35.  var baud_rate,baud_modem: word;
  36.  var node_num: byte;
  37.  var local: boolean;
  38.  var graphics: byte;
  39.  var color1: boolean;
  40.  var color_chg: boolean;
  41.  var board_name: string;
  42.  var sysop_first_name: string;
  43.  var sysop_last_name: string;
  44.  var maxtime: word;
  45.  var dropfilepath: string;
  46.  var lockbaud: word);
  47.  
  48. const
  49.  numddovrstr=11;
  50. type
  51.  ddovrstrptr=^string;
  52.  ddovrstrarray=array[1..numddovrstr] of ddovrstrptr;
  53. var
  54.  ddovrinfo: ddovrstrarray;
  55.  
  56. implementation
  57.  
  58. procedure GetBBSInfo(
  59.  bbstype: word;
  60.  var user_first_name,user_last_name: string;
  61.  var user_access_level: word;
  62.  var bbs_time_left: integer;
  63.  var com_port: byte;
  64.  var baud_rate: LongInt;
  65.  var node_num: byte;
  66.  var local: boolean;
  67.  var graphics: byte;
  68.  var color1: boolean;
  69.  var color_chg: boolean;
  70.  var board_name: string;
  71.  var sysop_first_name: string;
  72.  var sysop_last_name: string;
  73.  var maxtime: word;
  74.  var dropfilepath: string;
  75.  var lockbaud: LongInt);
  76.  
  77. type
  78.  
  79.    char2  = array[1..2] of char;
  80.    char4  = array[1..4] of char;
  81.    char5  = array[1..5] of char;
  82.    char8  = array [1..8] of char;
  83.    char9  = array [1..9] of char;
  84.    char12 = array[1..12] of char;
  85.    char13 = array [1..13] of char;
  86.    char15 = array[1..15] of char;
  87.    char25 = array[1..25] of char;
  88.    single = array [0..3] of byte;
  89.    bitmap = record
  90.      bits : array [0..4] of byte;
  91.    end;
  92.  
  93.    basic_real_type = array[1..4] of char;
  94.  
  95.    {layout of the PCBOARD12.SYS file while doors are open}
  96.  
  97.    pcb_sys_rec12 = record
  98.       display:        char2;          {display on console?  -1 or 0}
  99.       printer:        char2;          {print log?           -1 or 0}
  100.       page_bell:      char2;          {bother sysop?        -1 or 0}
  101.       alarm:          char2;          {caller alarm sound?  -1 or 0}
  102.       sysop_next:     char2;          {force sysop on next? 'N ', 'X ' or '  '}
  103.  
  104.       baud:           array [1..4] of char;       {caller's baud rate}
  105.       name:           char25;         {caller's name}
  106.       xpert:          char;           {pcb/pro's own expert flag}
  107.       nulls:          char;           {pcb/pro's own nulls flag}
  108.       firstname:      array [1..15] of char;      {caller's first name}
  109.       graphics:       char2;       {ansi graphics mode?  '-1',' 0', or '7E'}
  110.       password:       array [1..12] of char;      {caller's password (last 2 chars redef'd}
  111.       usernum:        integer;        {record number in user file}
  112.       time_on:        Basic_real_type;
  113.       time_limit:     Basic_real_type;
  114.       open_time:      Basic_real_type;
  115.       time_logged:    array [1..5] of char;       {time the user logged on in hh:mm}
  116.       conference:     integer;        {active conference when door opened}
  117.       joined:         array[1..9] of integer;
  118.                                       {0 or -1 for conferences joined}
  119.       time_added:     integer;        {highest conference added time in mins}
  120.       down_limit:     array[1..8] of char;
  121.       upload_credit:  integer;        {upload time credit so far that call}
  122.  
  123.       slanguage:      array [1..4] of char;       {language version used, blank, .FRE etc}
  124.       errcheck:       char2;          {error check/correcting modem? -1 or 0}
  125.       nodechat:       char;           {node chat flag prior to exit to DOS}
  126.    end;
  127.  
  128. var
  129.  pcbsys:       pcb_sys_rec12;
  130.  
  131. function wva(a: word): string;
  132. var
  133.  s: string;
  134. begin;
  135.  str(a,s);
  136.  wva:=s;
  137. end;
  138.  
  139. function stu(s: string): string;
  140. var
  141.  a: integer;
  142. begin;
  143.  for a:=1 to length(s) do s[a]:=upcase(s[a]);
  144.  stu:=s;
  145. end;
  146.  
  147. procedure DDError(s: string);
  148. begin;
  149.  write(^G^G);
  150.  writeln('ERROR: '+s);
  151.  write(^G^G);
  152.  delay(2000);
  153.  halt;
  154. end;
  155.  
  156. function basic_real(breal: basic_real_type): real;
  157. type
  158.  atmp=array[1..6] of char;
  159. var
  160.  dummy: real;
  161.  x: atmp absolute dummy;
  162. begin;
  163.  x[1]:=breal[4];
  164.  x[2]:=#0;
  165.  x[3]:=#0;
  166.  x[4]:=breal[1];
  167.  x[5]:=breal[2];
  168.  x[6]:=breal[3];
  169.  basic_real:=int(dummy);
  170. end;
  171.  
  172. procedure get_pcbsys_file;
  173. var
  174.    fd:  file of pcb_sys_rec12;
  175. begin
  176.  assign(fd,dropfilepath+'PCBOARD.SYS');
  177.  {$i-} reset(fd); {$i+}
  178.  if ioresult <> 0 then begin;
  179.   dderror('Can''t read system file PCBOARD.SYS');
  180.   halt;
  181.  end;
  182.  read(fd,pcbsys);
  183.  close(fd);
  184. end;
  185.  
  186. function pcboard_time_left: byte;
  187. var
  188.  tl: integer;
  189.  time_used: real;
  190.  time_left: real;
  191. begin;
  192.  time_used:=basic_real(pcbsys.open_time)-basic_real(pcbsys.time_on);
  193.  time_left:=basic_Real(pcbsys.time_limit)-(time_used);
  194.  tl:=round(time_left/60);
  195.  if tl>255 then tl:=255;
  196.  pcboard_time_left:=tl;
  197. end;
  198.  
  199. procedure GetPcb14(var fname,lname: string; var comport,baud,graphics,tleft: integer);
  200. Type
  201.    {layout of the PCBOARD14.SYS file while doors are open}
  202. {
  203.    Offset   Type   Length  Description
  204.    ------  ------  ------  -----------
  205.       0    str        2    Display On/Off ("-1" = On, " 0" = Off)
  206.       2    str        2    Printer On/Off ("-1" = On, " 0" = Off)
  207.       4    str        2    Page Bell On/Off ("-1" = On, " 0" = Off)
  208.       6    str        2    Caller Alarm On/Off ("-1" = On, " 0" = Off)
  209.       8    char       1    Sysop Flag (" ", "N"=sysop next, "X"=exit dos)
  210.       9    str        2    Error Corrected ("-1" = On, " 0" = Off)
  211.      11    char       1    Graphics Mode ('Y'=yes, 'N'=no, '7'=7E1)
  212.      12    char       1    Node Chat Status ('A'=available, 'U'=unavailable)
  213.      13    str        5    DTE Port Speed (PC to Modem speed)
  214.      18    str        5    Connect Speed shown to caller or "Local"
  215.      23    int        2    User's Record Number in the USERS file
  216.      25    str       15    User's First Name (padded to 15 characters)
  217.      40    str       12    User's Password (padded to 12 characters)
  218.      52    int        2    Time User Logged On (in minutes since midnight)
  219.      54    int        2    Time used so far today (negative number of minutes)
  220.      56    str        5    Time User Logged On (in "HH:MM" format)
  221.      61    int        2    Time Allowed On (from PWRD file) (see note 1 below)
  222.      63    int        2    Allowed K-Bytes for Download (see note 2 below)
  223.      65    char       1    Conference Area user was in (if <= 255)
  224.      66    bitmap     5    Conference Areas the user has joined this session
  225.      71    bitmap     5    Conference Areas the user has scanned this session
  226.      76    int        2    Conference Add Time in minutes
  227.      78    int        2    Upload/Sysop CHAT Credit Minutes (see note 3 below)
  228.      80    str        4    Language Extension (see note 4 below)
  229.      84    str       25    User's Full Name (padded to 25 characters)
  230.     109    int        2    Calculated Minutes Remaining (see note 5 below)
  231.     111    char       1    Node Number (or ' ' if no network)
  232. |   112    str        5    Event Time (in "HH:MM" format, "00:00" if no event)
  233. |   117    str        2    Is Event Active ("-1" = On, " 0" = Off) (see note 7)
  234. |   119    str        2    Reserved (was Slide Event, no longer used here)
  235.     121    bsreal     4    Memorized Message Number
  236.     125    char       1    Comm Port Number (0=none, 1-8)
  237.     126    char       1    Reserved for PCBoard
  238. |   127    bitmap     1    See Node 8 below for details
  239.     128    char       1    Use ANSI (1 = Yes, 0 = No)
  240. |   129    int        2    Country Code
  241. |   131    int        2    Code Page
  242. |   133    char       1    YES character
  243. |   134    char       1    NO character
  244. |   135    char       1    Language 0=None, otherwise correspond with PCBML.DAT
  245. |   136    char       3    RESERVED
  246.     139    char       1    Caller Exited to DOS (1 = Yes, 0 = No)
  247. |   140    char       1    RESERVED (was Event Up Coming, no longer used)
  248.     141    char       1    Stop Uploads (1 = Yes, 0 = No)
  249.     142    int        2    Conference Area user was in (up to 65535)
  250.     144    bitmap  varies  High Conference Areas the user has joined (note 6)
  251.    varies  bitmap  varies  High Conference Areas the user has scanned (note 6)
  252. |  variees int        2    Node Number if offset 111 is set to 255, seek to
  253.                            the end of the file, minus 2, to read this value
  254. }
  255.    pcb_sys_rec14 = record
  256.     {1  } display:        char2;          {display on console?  -1 or 0}
  257.     {3  } printer:        char2;          {print log?           -1 or 0}
  258.     {5  } page_bell:      char2;          {bother sysop?        -1 or 0}
  259.     {7  } alarm:          char2;          {caller alarm sound?  -1 or 0}
  260.     {9  } sysop_next:     char;           {force sysop on next? 'N', 'X' or ' '}
  261.  
  262.     case integer of
  263.     1: (
  264.     {10 } errcheck:       char2;          {error check/correcting modem? -1 or 0}
  265.     {12 } graphics:       char;           {ansi graphics mode?   'Y','N','7'}
  266.     {13 } nodechat:       char;           {node chat status 'U' or 'A'}
  267.     {14 } openbps:        char5;          {BPS rate to open modem port at}
  268.     {19 } connectbps:     char5;          {BPS connect rate or 'Local'}
  269.     {24 } usernum:        integer;        {record number in user file}
  270.     {26 } firstname:      char15;         {caller's first name}
  271.     {41 } password:       char12;         {caller's password}
  272.     {53 } time_on:        integer;        {when the user logged on in MINUTES}
  273.     {55 } prev_used:      integer;        {minutes used in prev calls today, <0}
  274.     {57 } time_logged:    char5;          {hh:mm time the user logged on}
  275.     {62 } time_limit:     integer;        {maximum minutes allowed from PWRD}
  276.     {64 } down_limit:     integer;        {daily download limit/1024 from PWRD}
  277.     {66 } curconf:        byte;           {active conference when door opened}
  278.     {67 } joined:         bitmap;         {areas user has been in}
  279.     {72 } ydone:          bitmap;         {areas user has done 'Y' on}
  280.     {77 } time_added:     integer;        {highest conference added time in mins}
  281.     {79 } time_credit:    integer;        {upload/chat time credit in minutes}
  282.     {81 } slanguage:      char4;          {language used, blank, .FRE etc}
  283.     {85 } name:           char25;         {caller's full name}
  284.     {110} sminsleft:      integer;        {minutes left when door opened}
  285.     {112} snodenum:       byte;           {current node number}
  286.     {113} seventtime:     char5;          {hh:mm event time}
  287.     {118} seventactive:   char2;          {event time active? "-1" or "0 "}
  288.     {120} sslide:         char2;          {slide event? "-1" or " 0"}
  289.     {122} smemmsg:        single;         {memorized message number}
  290.     {126} scomport:       char;           {com port number '0','1','2'}
  291.     {127} resv99:         char;           {filler UNDOCUMENTED}
  292.     {128} bitmap:         byte;           {rip is bit $02     }
  293.     {record size: 128}
  294.       );
  295.  
  296.     2: (
  297.       offline_filler:    array[1..119] of char      {filler, spaces}
  298.       );
  299.    end;
  300.  
  301. VAR
  302.    pcbfile  : file;
  303.    pcb14    : pcb_sys_rec14;
  304.    qbbsout  : text;
  305.    filname  : string[8];
  306.    lastname : string[20];
  307.    graph    : integer;
  308.    sys_name,sysopfirst,sysoplast : string[30];
  309.    a,b,i    : integer;
  310.    c        : char;
  311.    s: string;
  312.    Name        : String[25];
  313.    GM          : String[2];
  314.  
  315. Begin
  316.  Assign(PCBFile,dropfilepath+'PCBoard.Sys');
  317.  {$I-}
  318.  Reset(PCBFile);
  319.  {$I+}
  320.  If (IOResult<>0) Then dderror('... Unable to open pcboard.sys file...');
  321.  BlockRead(PCBFile,PCB14,1);
  322.  Close(PCBFile);
  323.  Name:=pcb14.name;
  324.  FName:=pcb14.firstname;
  325.  LName:=Copy(Name,Pos(' ',Name)+1,Length(Name));
  326. { If (Data[23]=' ') Then Data[23]:='.'; }
  327.  s:='';
  328.  s :=s+Pcb14.SComPort;
  329.  Val(s,ComPort,I);
  330.  s:='';
  331.  for a:= 1 to 5 do
  332.    s:=s+Pcb14.openbps[a];
  333.  while s[length(s)]=' ' do delete(s,length(s),1);
  334.  val(s,baud,i);
  335.  If PCB14.connectbps='Local' then
  336.      baud:=0;
  337.  If (baud=0) Then ComPort:=0;
  338.  
  339.  Case Pcb14.graphics of
  340.   'Y': begin
  341.         Graphics:=2;
  342.        end;
  343.   'N': begin
  344.         Graphics:=0;
  345.        end;
  346.   '7': begin
  347.         Graphics:=0;
  348.        end;
  349.  End; {Case}
  350.  If BBStype = 6 then
  351.    If (PCB14.Bitmap And $02 = $02) then
  352.       Graphics := 4;
  353.  TLeft:=pcb14.sminsleft;
  354.  while ((fname[1]=#0) or (fname[1]=#32)) and (length(fname)>1) do delete(fname,1,1);
  355.  while ((fname[length(fname)]=#0) or (fname[length(fname)]=#32)) and (length(fname)>1) do delete(fname,length(fname),1);
  356.  while ((lname[1]=#0) or (lname[1]=#32)) and (length(lname)>1) do delete(lname,1,1);
  357.  while ((lname[length(lname)]=#0) or (lname[length(lname)]=#32)) and (length(lname)>1) do delete(lname,length(lname),1);
  358.  for a:=1 to length(fname) do fname[a]:=upcase(fname[a]);
  359.  for a:=1 to length(lname) do lname[a]:=upcase(lname[a]);
  360. end;
  361.  
  362. procedure load_rbbs16;
  363. var
  364.  fd:    text;
  365.  a,b: integer;
  366.  s,s2: string;
  367. begin
  368.  If BBStype=3 then color1 := true;
  369.  assign(fd,dropfilepath+'DORINFO'+wva(node_num)+'.DEF');
  370.  {$i-}
  371.  reset(fd);
  372.  {$i+}
  373.  if ioresult <> 0 then dderror('Can''t open DORINFO'+wva(node_num)+'.DEF');
  374.  local:=false;
  375.  readln(fd,s);
  376.  readln(fd,s);
  377.  readln(fd,s);
  378.  readln(fd,s);
  379.  val(s[4],com_port,a);
  380.  if com_port=0 then local:=true;
  381.  readln(fd,s);
  382.  s2:='';
  383.  s:=stu(s);
  384.  for a:=1 to pos('BAUD',s)-2 do s2:=s2+s[a];
  385.  if s2[1]=' ' then delete(s2,1,1);
  386.  val(s2,baud_rate,a);
  387.  if (stu(s2)='LOCA') or (stu(s2)='LOCAL') then local:=true;
  388.  if baud_rate=0 then local:=true;
  389.  readln(fd,s);
  390.  readln(fd,user_first_name);
  391.  readln(fd,user_last_name);
  392.  readln(fd,s);
  393.  readln(fd,s);
  394.  if s[1]=' ' then delete(s,1,1);
  395.  while s[length(s)]=' ' do delete(s,length(s),1);
  396.  val(s,graphics,a);
  397.  inc(graphics);
  398.  if color1 then inc(graphics);
  399.  readln(fd,s);
  400.  if s[1]=' ' then delete(s,1,1);
  401.  while s[length(s)]=' ' do delete(s,length(s),1);
  402.  val(s,user_access_level,a);
  403.  readln(fd,s);
  404.  if s[1]=' ' then delete(s,1,1);
  405.  while s[length(s)]=' ' do delete(s,length(s),1);
  406.  val(s,bbs_time_left,a);
  407.  close(fd);
  408.  user_first_name:=stu(user_first_name);
  409.  user_last_name:=stu(user_last_name);
  410. end;
  411.  
  412. procedure Load_pcboard14;
  413. var
  414.  tleft,com,baud,graph: integer;
  415. begin;
  416.  getpcb14(user_first_name,user_last_name,com,baud,graph,tleft);
  417.  com_port:=com;
  418.  baud_rate:=baud;
  419.  graphics:=graph;
  420.  bbs_time_left:=tleft;
  421.  user_access_level:=50;
  422.  inc(graphics);
  423.  if (baud_rate=0) or (com_port=0) then local:=true else local:=false;
  424. end;
  425.  
  426. procedure load_pcboard;
  427. var
  428.  a: integer;
  429.  b: boolean;
  430.  ton,toff: real;
  431. begin;
  432.  user_access_level:=0;
  433.  local:=false;
  434.  get_pcbsys_file;
  435.  b:=false;
  436.  user_first_name:='';
  437.  user_last_name:='';
  438.  for a:=1 to 25 do if (pcbsys.name[a]=' ') or (pcbsys.name[a]=#0) then b:=true else if b=false then
  439.   user_first_name:=user_first_name+pcbsys.name[a] else user_last_name:=user_last_name+pcbsys.name[a];
  440.  baud_rate:=300;
  441.  if (pcbsys.baud[1]='1') and (pcbsys.baud[2]='2') then baud_rate:=1200;
  442.  if pcbsys.baud[1]='2' then baud_rate:=2400;
  443.  if pcbsys.baud[1]='4' then baud_rate:=4800;
  444.  if pcbsys.baud[1]='9' then baud_rate:=9600;
  445.  if (pcbsys.baud[1]='1') and (pcbsys.baud[2]='9') then baud_rate:=19200;
  446.  if pcbsys.baud[1]='L' then local:=true;
  447.  if pcbsys.graphics[2]='0' then graphics:=1 else graphics:=3;
  448.  bbs_time_left:=pcboard_time_left;
  449.  user_first_name:=stu(user_first_name);
  450.  user_last_name:=stu(user_last_name);
  451. end;
  452.  
  453. procedure load_phnx;
  454. var
  455.  f : text;
  456.  s : string;
  457.  code,i: integer;
  458.  b : boolean;
  459.  a: integer;
  460. begin;
  461.  assign(f,dropfilepath+'info.bbs');
  462.  writeln('Opening file "info.bbs"');
  463.  {$I-}
  464.  reset(f);
  465.  {$I+}
  466.  if ioresult<>0 then dderror('Error in opening "info.bbs"');
  467.  readln(f,s);
  468.  b:=false;
  469.  user_first_name:='';
  470.  user_last_name:='';
  471.  for a:=1 to 25 do if (pcbsys.name[a]=' ') or (pcbsys.name[a]=#0) then b:=true else if b=false then
  472.   user_first_name:=user_first_name+pcbsys.name[a] else user_last_name:=user_last_name+pcbsys.name[a];
  473.  readln(f,s); val(s,i,code); baud_rate:=i;
  474.  readln(f,s); val(s,i,code); com_port:=i;
  475.  readln(f,s); val(s,i,code); user_access_level:=i;
  476.  readln(f,s); s:=stu(s); if s='TRUE' then local:=true else local:=false;
  477.  readln(f,s);
  478.  readln(f,s); val(s,i,code); bbs_time_left:=i;
  479.  readln(f,s);
  480.  if s='TRUE' then graphics:=3 else graphics:=1;
  481.  if s='TRUE' then color_chg:=true else color_chg:=false;
  482.  readln(f,s);
  483.  close(f);
  484. end;
  485.  
  486. procedure load_WWIV;
  487. var
  488.  a: integer;
  489.  b: boolean;
  490.  f : text;
  491.  ss,s : string;
  492.  code,i: integer;
  493.  sint: word;
  494. begin;
  495.  assign(f,dropfilepath+'chain.txt');
  496.  writeln('Opening file "Chain.txt"');
  497.  {$I-}
  498.  reset(f);
  499.  {$I+}
  500.  if ioresult<>0 then dderror('Error in opening "Chain.txt"');
  501.  readln(f,s);
  502.  readln(f,s);
  503.  user_first_name:='';
  504.  user_last_name:='';
  505.  b:=false;
  506.  for a:=1 to length(s) do if s[a]=' ' then b:=true else if b then
  507.   user_last_name:=user_last_name+s[a] else user_first_name:=user_first_name+s[a];
  508.  for i:=1 to 9 do begin;
  509.   readln(f,s);
  510.  end;
  511.  val(s,sint,code);
  512.  user_access_level:=sint;
  513.  readln(f,s);
  514.  readln(f,s);
  515.  readln(f,s);
  516.  if s<>'0' then begin graphics:=3;color_chg:=true; end else begin;
  517.   graphics:=1;
  518.   color_chg:=false;
  519.  end;
  520.  readln(f,s);
  521.  if s<>'0' then local:=false else local:=true;
  522.  readln(f,s);
  523.  while (s<>'') and (s[1]=' ') do delete(s,1,1);
  524.  delete(s,length(s)-3,3);
  525.  val(s,sint,code);
  526.  bbs_time_left:=sint div 60;
  527.  readln(f,s);
  528.  readln(f,s);
  529.  readln(f,s);
  530.  readln(f,s);
  531.  val(s,sint,code);
  532.  baud_rate:=sint;
  533.  readln(f,s);
  534.  val(s,sint,code);
  535.  com_port:=sint;
  536.  readln(f,s);
  537.  board_name:=s;
  538.  readln(f,s);
  539.  sysop_first_name:='';
  540.  sysop_last_name:='';
  541.  b:=false;
  542.  for a:=1 to length(s) do if s[a]=' ' then b:=true else if b then
  543.    sysop_last_name:=sysop_last_name+s[a] else sysop_first_name:=sysop_first_name+s[a];
  544.  close(f);
  545. end;
  546.  
  547. procedure load_WildCat;
  548. var
  549.  f : text;
  550.  s : string;
  551.  code,i: integer;
  552.  sint: word;
  553.  a: integer;
  554.  b: boolean;
  555. begin;
  556.  assign(f,dropfilepath+'callinfo.bbs');
  557.  writeln('Opening file "Callinfo.bbs".');
  558.  {$I-}
  559.  reset(f);
  560.  {$I+}
  561.  if ioresult<>0 then dderror('Error in opening "Callinfo.bbs"');
  562.  readln(f,s);
  563.  user_first_name:='';
  564.  user_last_name:='';
  565.  b:=false;
  566.  for a:=1 to length(s) do if s[a]=' ' then b:=true else if b then
  567.   user_last_name:=user_last_name+s[a] else user_first_name:=user_first_name+s[a];
  568.  readln(f,s);
  569.  readln(f,s);
  570.  readln(f,s);
  571.  val(s,sint,code);
  572.  user_access_level:=sint;
  573.  readln(f,s);
  574.  val(s,sint,code);
  575.  bbs_time_left:=sint;
  576.  readln(f,s);
  577.  if stu(s)='COLOR' then begin;
  578.   graphics:=3;
  579.   color_chg:=true;
  580.  end else begin;
  581.   graphics:=1;
  582.   color_chg:=false;
  583.  end;
  584.  for i:=1 to 22 do readln(f,s);
  585.  if stu(s)='REMOTE' then local:=false else local:=true;
  586.  readln(f,s);
  587.  val(s[4],sint,code);
  588.  com_port:=sint;
  589.  readln(f,s);
  590.  readln(f,s);
  591.  val(s,sint,code);
  592.  baud_rate:=sint;
  593.  close(f);
  594. end;
  595.  
  596. procedure load_doorsys;
  597. var
  598.  b: boolean;
  599.  a: integer;
  600.  f: text;
  601.  s: string;
  602. begin;
  603.  writeln('Opening "DOOR.SYS".');
  604.  assign(f,dropfilepath+'DOOR.SYS');
  605.  {$I-}
  606.  reset(F);
  607.  {$I+}
  608.  if ioresult<>0 then dderror('Cannot load DOOR.SYS');
  609.  
  610.  readln(f,s); {Com Port}
  611.  delete(s,1,3);
  612.  delete(s,2,1);
  613.  val(s,com_port,a);
  614.  if com_port=0 then local:=true else local:=false;
  615.  
  616.  readln(f,s); { remote baud rate}
  617.  readln(f,s); {dbits}
  618.  readln(f,s); {node num}
  619.  
  620.  readln(f,s); {actual internal bbs}
  621.  val(s,baud_rate,a);
  622.  readln(f,s); {screen on}
  623.  readln(f,s); {printer}
  624.  readln(f,s); {page bell}
  625.  readln(f,s); {caller bell}
  626.  
  627.  readln(f,s); {user name}
  628.  s:=stu(s);
  629.  b:=false;
  630.  user_first_name:='';
  631.  user_last_name:='';
  632.  for a:=1 to length(s) do if s[a]=' ' then b:=true else if b then
  633.   user_last_name:=user_last_name+upcase(s[a]) else user_first_name:=user_first_name+upcase(s[a]);
  634.  
  635.  readln(f,s); {city,state}
  636.  readln(f,s); {home phone}
  637.  readln(f,s); {work phone}
  638.  readln(f,s); {password}
  639.  
  640.  readln(f,s); {security}
  641.  val(s,user_access_level,a);
  642.  
  643.  readln(f,s); {times on}
  644.  readln(f,s); {last called}
  645.  readln(f,s); {secs left}
  646.  
  647.  readln(f,s); {time left}
  648.  val(s,bbs_time_left,a);
  649.  
  650.  readln(f,s); {graphics code}
  651.  if s='GR' then graphics:=3
  652.  else
  653.  if s='RIP' then graphics:=5
  654.  else graphics:=1;
  655.  
  656.  close(f);
  657. end;
  658.  
  659. procedure load_spitfire;
  660. var
  661.  b: boolean;
  662.  a: integer;
  663.  f: text;
  664.  s: string;
  665. begin;
  666.  writeln('Opening "SFDOORS.DAT".');
  667.  assign(f,dropfilepath+'SFDOORS.DAT');
  668.  {$I-}
  669.  reset(F);
  670.  {$I+}
  671.  if ioresult<>0 then dderror('Cannot load SFDOORS.DAT');
  672.  
  673.  readln(f,s);
  674.  readln(f,s); {name}
  675.  s:=stu(s);
  676.  b:=false;
  677.  user_first_name:='';
  678.  user_last_name:='';
  679.  for a:=1 to length(s) do if s[a]=' ' then b:=true else if b then
  680.   user_last_name:=user_last_name+upcase(s[a]) else user_first_name:=user_first_name+upcase(s[a]);
  681.  
  682.  readln(f,s);
  683.  readln(f,s);
  684.  readln(f,s); {baud}
  685.  val(s,baud_rate,a);
  686.  if baud_rate=0 then local:=true else local:=false;
  687.  
  688.  readln(f,s); {cport}
  689.  val(s,com_port,a);
  690.  if com_port=0 then local:=true else local:=false;
  691.  
  692.  readln(f,s); {time left}
  693.  val(s,bbs_time_left,a);
  694.  
  695.  readln(f,s);
  696.  readln(f,s);
  697.  readln(f,s); {ansi}
  698.  if stu(s)='TRUE' then graphics:=3 else graphics:=1;
  699.  
  700.  readln(f,s); {sec}
  701.  val(s,user_access_level,a);
  702.  
  703.  close(f);
  704. end;
  705.  
  706. procedure Load_2am;
  707. var
  708.  f: text;
  709.  s,s2: string;
  710.  a: integer;
  711. begin;
  712.  local:=false;
  713.  user_access_level:=0;
  714.  writeln('Opening JUMPER.DAT');
  715.  assign(f,dropfilepath+'JUMPER.DAT');
  716.  {$I-}
  717.  reset(F);
  718.  {$I+}
  719.  if ioresult<>0 then dderror('Cannot open JUMPER.DAT');
  720.  readln(f,s);
  721.  readln(f,s);
  722.  readln(f,s);
  723.  readln(f,s);
  724.  
  725.  readln(f,s);
  726.  user_first_name:=s;
  727.  readln(f,s);
  728.  user_last_name:=s;
  729.  
  730.  readln(f,s);
  731.  
  732.  readln(f,s);
  733.  val(s,bbs_time_left,a);
  734.  readln(f,s);
  735.  val(s,com_port,a);
  736.  if com_port=0 then local:=true;
  737.  readln(f,s);
  738.  val(s,baud_rate,a);
  739.  if baud_rate=0 then local:=true;
  740.  
  741.  readln(f,s);
  742.  readln(f,s);
  743.  readln(f,s);
  744.  readln(f,s);
  745.  
  746.  readln(f,s);
  747.  readln(f,s2);
  748.  graphics:=1;
  749.  if (s='TRUE') and (s2='FALSE') then graphics:=2;
  750.  if (s2='TRUE') then graphics:=3;
  751.  close(f);
  752. end;
  753.  
  754. procedure Load_TriBBS;
  755. var
  756.  b: boolean;
  757.  a: integer;
  758.  f: text;
  759.  s,s2: string;
  760. begin;
  761.  local:=false;
  762.  user_access_level:=0;
  763.  writeln('Opening TRIBBS.SYS');
  764.  assign(f,dropfilepath+'TRIBBS.SYS');
  765.  {$I-}
  766.  reset(F);
  767.  {$I+}
  768.  if ioresult<>0 then dderror('Cannot open TRIBBS.SYS');
  769.  readln(f,s);
  770.  readln(f,s); {user name}
  771.  s:=stu(s);
  772.  b:=false;
  773.  user_first_name:='';
  774.  user_last_name:='';
  775.  for a:=1 to length(s) do if s[a]=' ' then b:=true else if b then
  776.   user_last_name:=user_last_name+upcase(s[a]) else user_first_name:=user_first_name+upcase(s[a]);
  777.  readln(f,s);  {password }
  778.  readln(f,s);  {security}
  779.  readln(f,s);  {help lev}
  780.  readln(f,s);  {graphics}
  781.  If s = 'Y' then
  782.   graphics := 3
  783.  else
  784.   graphics := 1;
  785.  
  786.  readln(f,s); {minutes left}
  787.  val(s,bbs_time_left,a);
  788.  
  789.  readln(f,s); {phonenumber}
  790.  readln(f,s); {citystate  }
  791.  readln(f,s); {birthdate  }
  792.  readln(f,s); {nodenumber }
  793.  val(s,node_num,a);
  794.  readln(f,s);  {comportno }
  795.  val(s,com_port,a);
  796.  if com_port=0 then local:=true;
  797.  
  798.  readln(f,s); {modembaud rate }
  799.  val(s,baud_rate,a);
  800.  if baud_rate=0 then local:=true;
  801.  readln(f,s); {baud rate }
  802.  val(s,baud_rate,a);
  803.  lockbaud := baud_rate;
  804.  if baud_rate=0 then local:=true;
  805.  close(f);
  806. end;
  807.  
  808. procedure load_local;
  809. var
  810.  a,b: integer;
  811.  d: boolean;
  812.  s: string;
  813. begin;
  814.  val(paramstr(1),a,b);
  815.  if a>0 then node_num:=a;
  816.  local:=true;
  817.  writeln;
  818.  writeln('┌───────────────────────────────┐');
  819.  writeln('│          Local Logon          │');
  820.  writeln('└───────────────────────────────┘');
  821.  writeln;
  822.  writeln('Please enter your name below (or leave blank for '+sysop_first_name+' '+sysop_last_name+'):');
  823.  write('>');
  824.  readln(s);
  825.  if s='' then begin;
  826.   user_first_name:=stu(sysop_first_name);
  827.   user_last_name:=stu(sysop_last_name);
  828.  end else begin;
  829.   user_first_name:='';
  830.   user_last_name:='';
  831.   d:=false;
  832.   for a:=1 to length(s) do if s[a]=' ' then d:=true else if d=false then
  833.    user_first_name:=user_first_name+upcase(s[a])
  834.   else
  835.    user_last_name:=user_last_name+upcase(s[a]);
  836.   if user_last_name='' then begin;
  837.    writeln('Please enter your last name:');
  838.    write('>');
  839.    readln(user_last_name);
  840.    user_last_name:=stu(user_last_name);
  841.   end;
  842.  end;
  843.  graphics:=3;
  844.  bbs_time_left:=120;
  845.  user_access_level:=255;
  846. end;
  847.  
  848. begin;
  849.  baud_rate:=0;
  850.  if bbstype=1 then load_local;
  851.  if bbstype=3 then load_rbbs16;
  852.  if bbstype=4 then load_pcboard;
  853.  if bbstype=5 then load_WWIV;
  854.  if bbstype=6 then load_pcboard14;
  855.  if bbstype=7 then load_rbbs16;
  856.  if bbstype=8 then load_phnx;
  857.  if bbstype=9 then load_WildCat;
  858.  if bbstype=10 then load_pcboard14;
  859.  if bbstype=11 then load_doorsys;
  860.  if bbstype=12 then load_spitfire;
  861.  if bbstype=13 then load_2am;
  862.  if bbstype=14 then load_TriBBS;
  863.  user_first_name:=stu(user_first_name);
  864.  user_last_name:=stu(user_last_name);
  865.  if node_num=0 then node_num:=1;
  866.  if graphics>=3 then color_chg:=true else color_chg:=false;
  867.  if bbs_time_left>maxtime then bbs_time_left:=maxtime;
  868. end;
  869.  
  870. function wva(w: word): string;
  871. var
  872.  s: string;
  873. begin;
  874.  str(w,s);
  875.  wva:=s;
  876. end;
  877.  
  878. procedure stuffstr(n: word; s: string);
  879. begin;
  880.  getmem(ddovrinfo[n],length(s)+1);
  881.  move(s,ddovrinfo[n]^,length(s)+1);
  882. end;
  883.  
  884. procedure MakeInfoStrings(
  885.  bbstype: word;
  886.  var user_first_name,user_last_name: string;
  887.  var user_access_level: word;
  888.  var bbs_time_left: integer;
  889.  var com_port: byte;
  890.  var baud_rate,baud_modem: word;
  891.  var node_num: byte;
  892.  var local: boolean;
  893.  var graphics: byte;
  894.  var color1: boolean;
  895.  var color_chg: boolean;
  896.  var board_name: string;
  897.  var sysop_first_name: string;
  898.  var sysop_last_name: string;
  899.  var maxtime: word;
  900.  var dropfilepath: string;
  901.  var lockbaud: word);
  902.  
  903. const
  904.  software_names: array[0..14] of string[15]=
  905.   ('Maint',     'Local',      'Sysop',      'QBBS',       'PCBoard 12',
  906.    'WWIV',      'PCBoard 15',        'RBBS 16+',   'Phoenix',    'Wildcat',
  907.    'PCBoard 14','DOORSYS',    'Spitfire',   '2am-bbs',   'TriBBS');
  908.  drop_files: array[0..14] of string[15]=
  909.   ('n/a',        'n/a',         'n/a',         'DORINFOx.DEF',
  910.    'PCBOARD.SYS','CHAIN.TXT','PCBOARD.SYS', 'DORINFOx.DEF',
  911.    'INFO.BBS',   'CALLINFO.BBS','PCBOARD.SYS', 'DOOR.SYS',
  912.    'SFDOORS.DAT','JUMPER.DAT','TRIBBS.SYS');
  913.  istrue: array[false..true] of string[8] = ('FALSE','TRUE');
  914. var
  915.  s: string;
  916.  a: integer;
  917. begin;
  918.  stuffstr( 1,'Baud rate: '+wva(baud_rate));
  919.  stuffstr( 2,'    Local: '+istrue[local]);
  920.  stuffstr( 3,' Graphics: '+wva(graphics));
  921.  stuffstr( 4,'Time left: '+wva(bbs_time_left));
  922.  stuffstr( 5,' Com Port: '+wva(com_port));
  923.  stuffstr( 6,'     User: '+user_first_name+' '+user_last_name);
  924.  stuffstr( 7,'Access lv: '+wva(user_access_level));
  925.  stuffstr( 8,' Node num: '+wva(node_num));
  926.  if lockbaud=0 then s:='Not Locked' else s:=wva(lockbaud);
  927.  stuffstr( 9,'Lock Baud: '+s);
  928.  stuffstr( 10,' Software: '+software_names[bbstype]);
  929.  s:=drop_files[bbstype];
  930.  for a:=1 to length(s) do if s[a]='x' then s[a]:=chr(node_num+ord('0'));
  931.  stuffstr(11,'Drop file: '+s);
  932.  stuffstr(12,'Drop Path: '+dropfilepath);
  933. end;
  934.  
  935. {
  936.  /E - Use ESM for extra memory');
  937.  /L - Local mode');
  938.  /Bxxx - Specify locked baud rate (i.e. /B38400)');
  939.  /C    - Specify comport number.
  940.  /Nx   - Specify node number');
  941.  /R    - Force RIP graphics');
  942.  /Pyyy - Specify path to drop file (i.e. /Pc:\bbs');
  943.  
  944.     }
  945.  
  946. end.